package com.teatrace.model.pack;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.teatrace.model.base.Device;
import com.teatrace.model.base.Employee;

@Entity
@Table(name="box_product")
public class BoxProduct {

	@Id
	@Column(name="box_product_id")
	private long boxProductId;//box_product_id
	private String wrapper;
	private String weight;
	@Column(name="pack_time",columnDefinition="datetime")
	private String packTime;//pack_time;
	private String description;
	private String quality;
	private int validity; //有效期
	private boolean deleted;

	
	@OneToMany
	@JoinTable(
			name="r_box_particle",
			joinColumns = @JoinColumn(name="box_product_id"),
			inverseJoinColumns=@JoinColumn(name="particle_product_id")
			
	)
	private Set<ParticleProduct> particleProducts;
	
	
	@ManyToMany
	@JoinTable(
		name="r_employee_boxproduct",
		joinColumns=@JoinColumn(name="box_product_id"),
		inverseJoinColumns=@JoinColumn(name="employee_id")
	)
	private Set<Employee> emps;
	
	

	@ManyToMany
	@JoinTable(
		name="r_device_boxproduct",
		joinColumns=@JoinColumn(name="box_product_id"),
		inverseJoinColumns=@JoinColumn(name="device_id")
	)
	private Set<Device> devices;
	
	
	public long getBoxProductId() {
		return boxProductId;
	}
	public String getWrapper() {
		return wrapper;
	}
	public String getWeight() {
		return weight;
	}
	public String getPackTime() {
		return packTime;
	}
	public String getDescription() {
		return description;
	}
	public String getQuality() {
		return quality;
	}
	public boolean isDeleted() {
		return deleted;
	}

	public void setBoxProductId(long boxProductId) {
		this.boxProductId = boxProductId;
	}
	public void setWrapper(String wrapper) {
		this.wrapper = wrapper;
	}
	public void setWeight(String weight) {
		this.weight = weight;
	}
	public void setPackTime(String packTime) {
		this.packTime = packTime;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public void setQuality(String quality) {
		this.quality = quality;
	}
	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}
	public void setParticleProducts(Set<ParticleProduct> particleProducts) {
		this.particleProducts = particleProducts;
	}
	public Set<ParticleProduct> getParticleProducts() {
		return particleProducts;
	}
	public void setEmps(Set<Employee> emps) {
		this.emps = emps;
	}
	public Set<Employee> getEmps() {
		return emps;
	}
	public void setDevices(Set<Device> devices) {
		this.devices = devices;
	}
	public Set<Device> getDevices() {
		return devices;
	}
	public int getValidity() {
		return validity;
	}
	public void setValidity(int validity) {
		this.validity = validity;
	}
}
